﻿using System.Reflection;
using System.Runtime.InteropServices;

namespace NgpSharp
{
    public class HashEncoderLoader : DLLLoader
    {
        [DllImport("HashEncoder", EntryPoint = "grid_encode_backward")]
        public static extern void grid_encode_backward(IntPtr grad, IntPtr inputs, IntPtr embeddings, IntPtr offsets, IntPtr grad_embeddings, uint B, uint D, uint C, uint L, uint S
            , uint H, IntPtr dy_dx, IntPtr grad_inputs, uint gridtype, [MarshalAs(UnmanagedType.I1)] bool align_corners, uint interp);
        [DllImport("HashEncoder", EntryPoint = "hash_encoder_forward")]
        public static extern void hash_encoder_forward(IntPtr inputs, IntPtr embeddings, IntPtr offsets, IntPtr box_min, IntPtr box_max, double base_resolution, double b, IntPtr outputs, IntPtr dy_dx);
        [DllImport("HashEncoder", EntryPoint = "hash_encoder_backward")]
        public static extern void hash_encoder_backward(IntPtr grad, IntPtr inputs, IntPtr embeddings, IntPtr offsets, IntPtr box_min, IntPtr box_max, double base_resolution, double b, IntPtr grad_embeddings);
    }
}
